package state.example;

/**
 * 上午工作状态
 * @author Chen Guang
 * @date 2019/4/16 0016 上午 10:36
 */
public class ForenoonStateImpl implements State{
    @Override
    public void writeProgram(Work work) {
        if(work.getHour() < 12){
            System.out.println("当前时间："+ work.getHour() +",精神百倍");
        }else {
            work.setCurrent(new NoonStateImpl());
            work.writeProgram();
        }
    }
}
